package com.tarry.shop.search.domain.dto;

import com.tarry.shop.constant.ESConstant;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Document(indexName = ESConstant.ES_SHOP_INDEX)
@Data
public class GoodsDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    private Integer id;

    @Field(type = FieldType.Text, analyzer = ESConstant.IK_MAX_WORD)
    private String goodsName;

    @Field(type = FieldType.Double)
    private BigDecimal price;

    @Field(type = FieldType.Integer)
    private Integer goodsType;

    @Field(type = FieldType.Text, analyzer = ESConstant.IK_MAX_WORD)
    private String goodsDesc;

    @Field(type = FieldType.Auto)
    private List<GoodsImageDTO> images;


}
